import request from 'utils/request'
// 获取分个人中心
export function GetPurchaseMemberCenter() {
  return request({
    url: '/Purchase/GetPurchaseMemberCenter',
    method: 'post'
  })
}

// 获取分类列表
export function GetProductTypeTree(data) {
  return request({
    url: '/Purchase/GetProductTypeTree',
    method: 'post',
    data: data
  })
}

// 申请大B
export function ApplyPurchaseMember(data) {
  return request({
    url: '/Purchase/ApplyPurchaseMember',
    method: 'post',
    data: data
  })
}

// 获取商品记录（包含params和data？） 共享库存
export function GetProductPage(params, data) {
  return request({
    url: '/Purchase/GetProductPage',
    method: 'post',
    params: params,
    data: data
  })
}

// 获取商品详情
export function GetProductDetailPage(params) {
  return request({
    url: '/Purchase/GetProductDetailPage',
    method: 'post',
    params: params
  })
}

// 添加商品库存
export function SavePurchaseProductPriceStock(data) {
  return request({
    url: '/Purchase/SavePurchaseProductPriceStock',
    method: 'post',
    data: data
  })
}

// 获取商品列表 采购下单页面
export function GetPurchaseProductListPage(data) {
  return request({
    url: '/Purchase/GetPurchaseProductListPage',
    method: 'post',
    data: data
  })
}

// 获取商品列表 采购下单页面(按供应商)
export function GetSupplierPurchaseProductListPage(data) {
  return request({
    url: '/Purchase/GetSupplierPurchaseProductListPage',
    method: 'post',
    data: data
  })
}

// 获取采购商品详情
export function GetPurchaseProductDetailPage(params) {
  return request({
    url: '/Purchase/GetPurchaseProductDetailPage',
    method: 'post',
    params: params
  })
}

// 获取供应商信息
export function GetSupplierPage(params) {
  return request({
    url: '/Purchase/GetSupplierPage',
    method: 'post',
    params: params
  })
}

// 获取商品所有供货商数量
export function GetProductSupplierPage(params) {
  return request({
    url: '/Purchase/GetProductSupplierPage',
    method: 'post',
    params: params
  })
}

// 获取商品规格详情
export function GetProductCarPage(params) {
  return request({
    url: '/Purchase/GetProductCarPage',
    method: 'post',
    params: params
  })
}

// 添加购物车数据
export function AddPurchaseCars(data) {
  return request({
    url: '/Purchase/AddPurchaseCars',
    method: 'post',
    data: data
  })
}

// 获取购物车数据
export function GetPurchaseCarListPage(data) {
  return request({
    url: '/Purchase/GetPurchaseCarListPage',
    method: 'post',
    data: data
  })
}

// 获取下订单页面的购物车数据
export function GetPurchaseCarDetailPage(params) {
  return request({
    url: '/Purchase/GetPurchaseCarDetailPage',
    method: 'post',
    params: params
  })
}

// 提交订单
export function AddPurchaseOrder(data) {
  return request({
    url: '/Purchase/AddPurchaseOrder',
    method: 'post',
    data: data
  })
}

// 获取订单列表数据
export function GetPurchaseOrderListPage(data) {
  return request({
    url: '/Purchase/GetPurchaseOrderListPage',
    method: 'post',
    data: data
  })
}

// 审核订单
export function CheckPurchaseOrder(params) {
  return request({
    url: '/Purchase/CheckPurchaseOrder',
    method: 'post',
    params: params
  })
}

// 订单详情
export function PurchaseOrderDetail(params) {
  return request({
    url: '/Purchase/PurchaseOrderDetail',
    method: 'post',
    params: params
  })
}

// 取消订单
export function CanclePurchaseOrder(params) {
  return request({
    url: '/Purchase/CanclePurchaseOrder',
    method: 'post',
    params: params
  })
}
// 确认收货
export function ReceivePurchaseOrder(params) {
  return request({
    url: '/Purchase/ReceivePurchaseOrder',
    method: 'post',
    params: params
  })
}

// 订单发货－保存物流信息
export function SendPurchaseOrder(data) {
  return request({
    url: '/Purchase/SendPurchaseOrder',
    method: 'post',
    data: data
  })
}

// 获取快递公司列表
export function GetExpressList() {
  return request({
    url: '/Purchase/GetExpressList',
    method: 'post'
  })
}

// 保存个人信息
export function SavePurchaseMember(data) {
  return request({
    url: '/Purchase/SavePurchaseMember',
    method: 'post',
    data: data
  })
}

// 保存个人信息
export function DeletePurchaseCars(params) {
  return request({
    url: '/Purchase/DeletePurchaseCars',
    method: 'post',
    params: params
  })
}
//申请供应商
export function ApplySupplierByUser(model) {
  return request({
    url: '/Supplier/ApplySupplierByUser',
    method: 'post',
    data: {
			factoryName: model.factoryName.value, // 厂家名称
			contactTel: model.contactTel.value, // 手机号
			password: model.password.value, // 密码
			validCode: model.validCode.value, // 简介
			contactName: model.contactName.value, // 联系人
			logo: model.logo.value.join(','), // logo
			contactAddress: model.contactAddress.value, // 详细地址
			name: model.name.value, //店铺名称
			validType: model.validType,
			provinceName: model.provinceName,
			provinceId: model.provinceId,
			cityName: model.cityName,
			cityId: model.cityId,
			regionName: model.regionName,
			regionId: model.regionId,
			streetName: model.streetName,
			streetId: model.streetId,
			ID: model.ID
		}
  })
}
// 获取供应商信息
export function GetSupplierInfoByShopUserId() {
  return request({
    url: '/Supplier/GetSupplierInfoByShopUserId',
    method: 'post',
  })
}
